package com.eptok.gw.szcups.cups.codec;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

/**
 *@author:heqishan, Email:heqishan@gmail.com
 *2013-3-5 下午05:13:52
 */
public class ServerCodecFactory implements ProtocolCodecFactory {
	
	private ProtocolDecoder decoder;
	private ProtocolEncoder encoder;
	
	public ServerCodecFactory(String codecName) {
		decoder = new Decoder(codecName);
		encoder = new Encoder(codecName);
	}

	public ProtocolDecoder getDecoder(IoSession arg0) throws Exception {
		// TODO Auto-generated method stub
		return decoder;
	}

	public ProtocolEncoder getEncoder(IoSession arg0) throws Exception {
		// TODO Auto-generated method stub
		return encoder;
	}

}
